import logging
import unittest

from htmltestreport import HTMLTestReport
from common.logging_use import init_log_config
from config import BASE_DIR
from scripts.User_TestCase import Test_UserList

# 初始化日志的配置信息
init_log_config(BASE_DIR + '/log/ulm.log')

# 创建测试套件
suite = unittest.TestSuite()

# print("测试套件实例，创建成功！")
logging.info("测试套件实例，创建成功！")

# 添加测试类，组装测试用例
suite.addTest(unittest.makeSuite(Test_UserList))

# 创建HTMLTestReport类实例，runner
runner = HTMLTestReport("report/ulm.html", description="描述", title="标题")

runner.run(suite)
logging.info("测试报告生成成功")
